package com.rt.easyjava.common.utils.others;

import java.lang.reflect.Method;

public class InvokeMethodUtils {

    //
    public static Object invokeStaticMethod(String className, String methodName,
                                     Object arg) throws Exception {
        Class ownerClass = Class.forName(className);
        Method method = ownerClass.getMethod(methodName,Integer.class);
        return method.invoke(null, arg);
    }

/*

    public Object invokeStaticMethod(String className, String methodName,
                                     Object[] args) throws Exception {
        Class ownerClass = Class.forName(className);
        Class[] argsClass = new Class[args.length];
        for (int i = 0, j = args.length; i < j; i++) {
            argsClass[i] = args[i].getClass();
        }
        Method method = ownerClass.getMethod(methodName,argsClass);
        return method.invoke(null, args);
    }
*/
}
